﻿// (c) Copyright Max Kazarin.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

// <reference path='../Common/jquery-1.3.2.js' />
// <reference path='../Common/MicrosoftAjax.debug.js' />

Type.registerNamespace('jQueryNET.Controls');

jQueryNET.Controls.EHAlign = function() {
	throw Error.notImplemented();
}

jQueryNET.Controls.EHAlign.prototype = {
	/// <summary>
	/// не установлено
	/// </summary
	
	NotSet: 0,

	/// <summary>
	/// по левому краю
	/// </summary
	Left: 1,

	/// <summary>
	/// по центру
	/// </summary>
	Center: 2,

	/// <summary>
	/// по правому 

	/// </summary>
	Right: 3,

	/// <summary>
	/// по ширине
	/// </summary>
	Justify: 4
}

jQueryNET.Controls.EHAlign.registerEnum("jQueryNET.Controls.EHAlign");

jQueryNET.Controls.EVAlign = function() {
	throw Error.notImplemented();
}

jQueryNET.Controls.EVAlign.prototype = {
	/// <summary>
	/// не установлено
	/// </summary>
	NotSet: 0,

	/// <summary>
	/// по верхнему краю
	/// </summary>
	Top: 1,

	/// <summary>
	/// по центру
	/// </summary>
	Middle: 2,

	/// <summary>
	/// по нижнему краюres
	/// </summary>
	Bottom: 3
}

jQueryNET.Controls.EVAlign.registerEnum("jQueryNET.Controls.EVAlign");

jQueryNET.Controls.Grid = function jQueryNET$Controls$Grid(element) {
	jQueryNET.Controls.Grid.initializeBase(this, [element]);

	this._terminalCells = new Array();

	this._onContextMenuHandler = Function.eventWraper(this, this._onContextMenu);
	this._ScrollHandler = Function.eventWraper(this, this._onScroll);
	this._onHeaderMouseOverHandler = Function.eventWraper(this, this._onHeaderMouseOver);
	this._onHeaderMouseOutHandler = Function.eventWraper(this, this._onHeaderMouseOut);
	this._onHeaderClickHandler = Function.eventWraper(this, this._onHeaderClick);

	this._onRowMouseOverHandler = Function.eventWraper(this, this._onRowMouseOver),
	this._onRowMouseOutHandler = Function.eventWraper(this, this._onRowMouseOut);

	this._onRowClickHandler = Function.eventWraper(this, this._onRowClick),
	this._onRowDoubleClickHandler = Function.eventWraper(this, this._onRowDoubleClick);

	this._onFirstPageHandler = Function.createDelegate(this, this._onFirstPage);
	this._onLastPageHandler = Function.createDelegate(this, this._onLastPage);
	this._onBackPageHandler = Function.createDelegate(this, this._onBackPage);
	this._onForwardPageHandler = Function.createDelegate(this, this._onForwardPage);

	this._rootElement
		.addClass('grid');
}

jQueryNET.Controls.Grid.createElement = function(parent) {
	/// <summary>
	/// Static method for using on client-side. Create DOM element the control
	/// associated with
	/// </summary>
	/// <param name='parent' type='Sys.UI.DomElement' domElement='true'>
	/// Parent DOM element or jQuery selector
	/// </param>

	var element =
		$(parent)
			.append('<div>')
			.find('div:last');

	return element.get(0);
}

function jQueryNET$Controls$Grid$initialize() {
	jQueryNET.Controls.Grid.callBaseMethod(this, "initialize");

	this._rootElement.bind("contextmenu", this._onContextMenuHandler)

	this._createHeader();
	this._createBody();

	this.refresh();
	this._createFoter();
}

function jQueryNET$Controls$Grid$dispose() {
	jQueryNET.Controls.Grid.callBaseMethod(this, "dispose");
}

function jQueryNET$Controls$Grid$get_rowInPage() {
	if (arguments.length !== 0) throw Error.parameterCount();
	return this._rowInPage;
}

function jQueryNET$Controls$Grid$set_rowInPage(value) {
	var e = Function._validateParams(arguments, [
		{ name: "value", type: Number, mayBeNull: false }
	]);
	if (e) throw e;

	this._rowInPage = value;
}

function jQueryNET$Controls$Grid$get_header() {
	if (arguments.length !== 0) throw Error.parameterCount();
	return this._header;
}

function jQueryNET$Controls$Grid$set_header(value) {
	this._header = value;
}

function jQueryNET$Controls$Grid$get_pageIndex() {
	if (arguments.length !== 0) throw Error.parameterCount();
	return this._pageIndex;
}

function jQueryNET$Controls$Grid$set_pageIndex(value) {
	var e = Function._validateParams(arguments, [
		{ name: "value", type: Number, mayBeNull: false }
	]);
	if (e) throw e;

	if (value < 1)
		throw Error.argumentOutOfRange("pageIndex", value, jQueryNET.Resources.Grid_PageIndexOutOfRange);

	this._pageIndex = value;

	this._updateButtonState();
}

function jQueryNET$Controls$Grid$get_pageCount() {
	if (arguments.length !== 0) throw Error.parameterCount();

	return Math.ceil(this.get_rowCount() / this._rowInPage);
}

function jQueryNET$Controls$Grid$get_rowCount() {
	if (arguments.length !== 0) throw Error.parameterCount();
	if (!this._rowCount)
		this._rowCount = 0;
	return this._rowCount;
}

function jQueryNET$Controls$Grid$set_rowCount(value) {
	throw Error.invalidOperation(jQueryNET.Resources.Property_OnlyRead);
}


function jQueryNET$Controls$Grid$set_width(value) {
	jQueryNET.Controls.Grid.callBaseMethod(this, "set_width", [value]);

	this._rootElement.find('div.grid_scroller')
		.width(this._rootElement.innerWidth());

	this._rootElement.find('div.grid_header_inner')
		.width(this._rootElement.innerWidth());
}

function jQueryNET$Controls$Grid$set_height(value) {
	jQueryNET.Controls.Grid.callBaseMethod(this, "set_height", [value]);

	var toolBarHeight = 0
	if (this._toolbar)
		toolBarHeight = this._toolbar.get_height();
	this._rootElement.find('div.grid_scroller')
		.height(this._rootElement.innerHeight() - 
				this._rootElement.find('div.grid_header_inner').innerHeight() -
				toolBarHeight);
}

function jQueryNET$Controls$Grid$get_selectedIndex() {
	if (arguments.length !== 0) throw Error.parameterCount();

	if (!this._selectedRow)
		return -1;

	return parseInt(this._selectedRow.get(0).id);
}

function jQueryNET$Controls$Grid$get_rowData(rowIndex) {
	var e = Function._validateParams(arguments, [
		{ name: "rowIndex", type: Number, mayBeNull: false }
	]);
	if (e) throw e;

	return this._data[rowIndex];
}

function jQueryNET$Controls$Grid$_updateButtonState() {
	if (!this._firstPageButton)
		return;

	this._firstPageButton.set_enabled(this.get_pageIndex() > 1);
	this._backPageButton.set_enabled(this.get_pageIndex() > 1);
	this._lastPageButton.set_enabled(this.get_pageIndex() < this.get_pageCount());
	this._forwardPageButton.set_enabled(this.get_pageIndex() < this.get_pageCount());
	this._pageCountLable.set_text(String.format(jQueryNET.Resources.Grid_PageOf, this.get_pageCount()));
	this._pageNumberTextBox.set_text(this.get_pageIndex());
}

function jQueryNET$Controls$Grid$_onFirstPage() {
	this.set_pageIndex(1);
	this.refresh();
}

function jQueryNET$Controls$Grid$_onLastPage() {
	this.set_pageIndex(this.get_pageCount());
	this.refresh();
}

function jQueryNET$Controls$Grid$_onBackPage() {
	var pageIndex = this.get_pageIndex();
	if (pageIndex > 1) {
		this.set_pageIndex(pageIndex - 1);
		this.refresh();
	}
}

function jQueryNET$Controls$Grid$_onForwardPage() {
	var pageIndex = this.get_pageIndex();
	if (pageIndex < this.get_pageCount()) {
		this.set_pageIndex(pageIndex + 1);
		this.refresh();
	}
}

function jQueryNET$Controls$Grid$_createHeader() {
	if (!this.get_header())
		throw Error.invalidOperation(jQueryNET.Resources.Grid_UndefinedHeader);

	this._rootElement.find('td.extgrid_hd:not(.extgrid_hd_empty)')
		.unbind('click', this._onHeaderClickHandler);

	this._width = 0;
	var html = '<div class="grid_viewport">' +
			   '<div class="grid_header">' +
			   '<div class="grid_header_inner" style="width:' + (this._rootElement.innerWidth() + 2) + 'px">' +
			   '<div class="grid_header_offset">' +
			   '<table cellspacing="0" cellpadding="0" border="0">' +
			   '<thead>' +
			   '</thead>' +
			   '</table>' +
			   '</div>' +
			   '</div>' +
			   '<div class="grid_clear"></div>' +
			   '</div>' +
			   '</div>';
			   

	this._rootElement.append(html);
	var tHead = this._rootElement.find('div.grid_header thead');

	var fields = new Array();
	
	Array.forEach(this.get_header().Rows, function(rowElement, rowIndex, array) {
		tHead.append('<tr class="grid_hd_row">')

		var tdIndex = 0;
		Array.forEach(rowElement.Cells, function(cellElement, cellIndex, array) {

			if (cellElement.Field) {
				this._terminalCells[tdIndex] = cellElement;
				if (!Array.contains(fields, cellElement.Field))
					fields.push(cellElement.Field);
			}

			if (cellElement.Width == null || cellElement.Width == 0)
				cellElement.Width = 100;

			html = '<td id="' + rowIndex + "_" + cellIndex + '" class="grid_hd';
			if (!cellElement.Field)
				html += ' grid_hd_empty';
			html += '"';
			if (cellElement.Field)
				html += ' fieldindex="' + (this._terminalCells.length - 1) + '"';
			if (cellElement.RowSpan > 1)
				html += ' rowspan="' + cellElement.RowSpan + '"';
			if (cellElement.ColSpan > 1)
				html += ' colspan="' + cellElement.ColSpan + '"';
			var style = "";
			if (cellElement.HAlign != jQueryNET.Controls.EHAlign.NotSet)
				style += 'text-align:' + jQueryNET.Controls.EHAlign.toString(cellElement.HAlign).toLowerCase() + ';';
			if (style != "")
				html += ' style="' + style + '"';
			html += '></td>'

			if (cellElement.ColSpan > 1)
				tdIndex += cellElement.ColSpan;
			else
				tdIndex++;

			var tCell = tHead
				.find('tr:last')
				.append(html)
				.find('td:last');


			html = '<div class="grid_hd_inner" style="width:' + cellElement.Width + 'px"><a href="#" class="grid_hd_btn"></a>' + cellElement.Name;

			if (cellElement.Field)
				html += '<img class="grid_sort_icon" src="<%=WebResource("jQueryNET.Common.Images.s.gif")%>"/>';

			html += '</div>';

			var innerCell = tCell
				.append(html)
				.find('div');

			cellElement.Width = 2 * cellElement.Width - innerCell.innerWidth();
			innerCell.width(cellElement.Width);
		}, this)
	}, this);

	this._width = tHead.find('tr:last').innerWidth();

	this._fieldList = fields.toString();
	
	this._rootElement
		.find('td.grid_hd:not(.grid_hd_empty)')
		.hover(this._onHeaderMouseOverHandler, this._onHeaderMouseOutHandler)
		.bind('click', this._onHeaderClickHandler);
}

function jQueryNET$Controls$Grid$_createBody() {
	var html =
		'<div class="grid_scroller" style="height:{0}px; width:{1}px">' +
		'<div class="grid_body">' +
		'</div>' +
		'</div>';
	var bodyHeight = this._rootElement.innerHeight() - this._rootElement.find('div.grid_header_inner').innerHeight();
	html = String.format(html, bodyHeight, this._rootElement.innerWidth());
	this._rootElement.append(html);

	this._rootElement.find('div.grid_scroller').bind('scroll', this._ScrollHandler);
}


function jQueryNET$Controls$Grid$_createFoter() {
	this._toolbar = $create(
		jQueryNET.Controls.ToolBar,
		{
			items: [
			{
				type: jQueryNET.Controls.Button,
				properties: {
					imageClass: 'page_first'
				},
				events: {
					click: this._onFirstPageHandler
				}
			}, {
				type: jQueryNET.Controls.Button,
				properties: {
					imageClass: 'page_prev'
				},
				events: {
					click: this._onBackPageHandler
				}
			}, {
				type: jQueryNET.Controls.Separator
			}, {
				type: jQueryNET.Controls.Label,
				properties: { text: jQueryNET.Resources.Grid_Page }
			}, {
				type: jQueryNET.Controls.TextBox
			}, {
				type: jQueryNET.Controls.Label,
				properties: { text: jQueryNET.Resources.Grid_PageOf }
			}, {
				type: jQueryNET.Controls.Separator
			}, {
				type: jQueryNET.Controls.Button,
				properties: {
					imageClass: 'page_next'
				},
				events: {
					click: this._onForwardPageHandler
				}
			}, {
				type: jQueryNET.Controls.Button,
				properties: {
					imageClass: 'page_last'
				},
				events: {
					click: this._onLastPageHandler
				}
			}]
		},
		null,
		null,
		jQueryNET.Controls.ToolBar.createElement(this._rootElement.get(0))
	);

	//this._rootElement.height($(this._toolbar.get_element()).innerHeight() + this._rootElement.innerHeight());
	this._rootElement.find('div.grid_scroller').height(
		this._rootElement.innerHeight() -
		this._rootElement.find('div.grid_header_inner').innerHeight() -
		this._toolbar.get_height() + 1);

	var controls = this._toolbar.get_controls();
	this._firstPageButton = controls[0];
	this._backPageButton = controls[1];
	this._forwardPageButton = controls[7];
	this._lastPageButton = controls[8];
	this._pageCountLable = controls[5];
	this._pageNumberTextBox = controls[4];
	this._updateButtonState();
}

function jQueryNET$Controls$Grid$refresh() {
	this.receiveData({
		fields: this._fieldList,
		first: (this.get_pageIndex() - 1) * this.get_rowInPage(),
		count: this.get_rowInPage(),
		sortField: this._sortField,
		sortOrder: this._sortOrder
		},
		true);	
}

function jQueryNET$Controls$Grid$addRows(rows) {

	this._selectedRow = null;
	
	if (!rows)
		return;
	
	this._data = rows;
	
	var body = this._rootElement.find('div.grid_body');
	body.empty();

	if (rows.length == 0)
		return;

	Array.forEach(rows, function(row, index, array) {
		var html =
			'<div id="' + index + '" class="grid_row" style="width:' + this._width + 'px">' +
			'<table cellspacing="0" cellpadding="0" border="0" style="width:' + this._width + 'px" class="grid_table">' +
			'<tbody>' +
			'<tr>';

		Array.forEach(this._terminalCells, function(terminalCell, index, array) {
			var value = row[terminalCell.Field] ? row[terminalCell.Field] : '';
			html +=
				'<td tabindex="0" style="width:' + terminalCell.Width +
				'px"><div class="grid_cell_inner" unselectable="on" style="width:' + terminalCell.Width + 'px">' + value +
				'</div></td>';
		}, this);

		html +=
			'</tr>' +
			'</tbody>' +
			'</table>' +
			'</div>';

		body.append(html);

	}, this);

	body.find('div.grid_row')
		.bind('click', this._onRowClickHandler)
		.bind('dblclick', this._onRowDoubleClickHandler)
		.hover(this._onRowMouseOverHandler, this._onRowMouseOutHandler);
}

function jQueryNET$Controls$Grid$_showLoadingLayer() {
}

function jQueryNET$Controls$Grid$_hideLoadingLayer() {
}

function jQueryNET$Controls$Grid$_completeReceive(data) {
	this._rowCount = data.RowCount;
	this._updateButtonState();
	this.addRows(data.Rows);
}

function jQueryNET$Controls$Grid$_onContextMenu(event, sender) {
	var row = $(event.target).closest('div.grid_row')
	if (row.size() > 0) {
		if (this._selectedRow)
			this._selectedRow.removeClass('grid_row_selected')

		this._selectedRow = row;

		this._selectedRow.addClass('grid_row_selected');
	}
	
	this.raiseContextMenu(event);
	return false;
}

function jQueryNET$Controls$Grid$_onScroll(event, sender) {
	var scroller = $(sender);
	this._rootElement.find('div.grid_header_inner').scrollLeft(scroller.scrollLeft());
}

function jQueryNET$Controls$Grid$_onRowMouseOver(event, sender) {
	$(sender).addClass('grid_row_over');
}

function jQueryNET$Controls$Grid$_onRowMouseOut(event, sender) {
	$(sender).removeClass('grid_row_over');
}

function jQueryNET$Controls$Grid$_onRowClick(event, sender) {
	if (this._selectedRow)
		this._selectedRow.removeClass('grid_row_selected')
	
	this._selectedRow = $(sender);
	
	this._selectedRow.addClass('grid_row_selected');
		
	this.raiseRowClick(event);
}

function jQueryNET$Controls$Grid$_onRowDoubleClick(event, sender) {
	this.raiseRowDoubleClick(event);
}

function jQueryNET$Controls$Grid$_onHeaderMouseOver(event, sender) {
	$(sender).addClass('grid_hd_over');
}

function jQueryNET$Controls$Grid$_onHeaderMouseOut(event, sender) {
	$(sender).removeClass('grid_hd_over');
}

function jQueryNET$Controls$Grid$_onHeaderClick(event, sender) {
	var element = $(sender);
	var index = element.get(0).id;
	var values = index.split('_');
	if (values[0] == null || values[1] == null)
		return;
	var cellItem = this.get_header().Rows[values[0]].Cells[values[1]];
	if (cellItem == null || !cellItem.Field)
		return;

    var isAsc = element.hasClass('sort_asc');
	element.parent().parent()
		.find('td')
		.removeClass('sort_asc')
		.removeClass('sort_desc')

	if (isAsc)
		element
			.addClass('sort_desc')
			.removeClass('sort_asc');
	else
		element
			.addClass('sort_asc')
			.removeClass('sort_desc');

	this._sortField = cellItem.Field;
	this._sortOrder = element.hasClass('sort_asc');
	this.refresh();
}

function jQueryNET$Controls$Grid$add_rowClick(handler) {
	/// <summary>
	/// Add an event handler for the row click event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().addHandler('rowClick', handler);
}

function jQueryNET$Controls$Grid$remove_rowClick(handler) {
	/// <summary>
	/// Remove an event handler from the row click event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().removeHandler('rowClick', handler);
}

function jQueryNET$Controls$Grid$raiseRowClick(eventArgs) {
	/// <summary>
	/// Raise the row click event
	/// </summary>
	/// <param name='eventArgs' type='Sys.CancelEventArgs' mayBeNull='false'>
	/// Event arguments for the click event
	/// </param>
	/// <returns />

	var handler = this.get_events().getHandler('rowClick');
	if (handler) {
		handler(this, eventArgs);
	}
}

function jQueryNET$Controls$Grid$add_rowDoubleClick(handler) {
	/// <summary>
	/// Add an event handler for the row double click event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().addHandler('rowDoubleClick', handler);
}

function jQueryNET$Controls$Grid$remove_rowDoubleClick(handler) {
	/// <summary>
	/// Remove an event handler from the row double click event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().removeHandler('rowDoubleClick', handler);
}

function jQueryNET$Controls$Grid$raiseRowDoubleClick(eventArgs) {
	/// <summary>
	/// Raise the row double click event
	/// </summary>
	/// <param name='eventArgs' type='Sys.CancelEventArgs' mayBeNull='false'>
	/// Event arguments for the click event
	/// </param>
	/// <returns />

	var handler = this.get_events().getHandler('rowDoubleClick');
	if (handler) {
		handler(this, eventArgs);
	}
}

function jQueryNET$Controls$Grid$add_contextMenu(handler) {
	/// <summary>
	/// Add an event handler for the context event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().addHandler('contextmenu', handler);
}

function jQueryNET$Controls$Grid$remove_contextMenu(handler) {
	/// <summary>
	/// Remove an event handler from the context event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().removeHandler('contextmenu', handler);
}

function jQueryNET$Controls$Grid$raiseСontextMenu(eventArgs) {
	/// <summary>
	/// Raise the context event
	/// </summary>
	/// <param name='eventArgs' type='Sys.CancelEventArgs' mayBeNull='false'>
	/// Event arguments for the click event
	/// </param>
	/// <returns />

	var handler = this.get_events().getHandler('contextmenu');
	if (handler) {
		handler(this, eventArgs);
	}
}

jQueryNET.Controls.Grid.prototype = {
	_rowInPage: 10,
	_rowCount: null,
	_pageIndex: 1,
	_header: null,
	_terminalCells: null,
	_width: 0,
	_selectedRow: null,
	_data: null,
	_sortField: null,
	_sortOrder: false,

	initialize: jQueryNET$Controls$Grid$initialize,
	dispose: jQueryNET$Controls$Grid$dispose,

	get_rowInPage: jQueryNET$Controls$Grid$get_rowInPage,
	set_rowInPage: jQueryNET$Controls$Grid$set_rowInPage,
	get_header: jQueryNET$Controls$Grid$get_header,
	set_header: jQueryNET$Controls$Grid$set_header,
	get_pageIndex: jQueryNET$Controls$Grid$get_pageIndex,
	set_pageIndex: jQueryNET$Controls$Grid$set_pageIndex,
	get_pageCount: jQueryNET$Controls$Grid$get_pageCount,
	get_rowCount: jQueryNET$Controls$Grid$get_rowCount,
	set_rowCount: jQueryNET$Controls$Grid$set_rowCount,
	set_width: jQueryNET$Controls$Grid$set_width,
	set_height: jQueryNET$Controls$Grid$set_height,
	get_selectedIndex: jQueryNET$Controls$Grid$get_selectedIndex,
	get_rowData: jQueryNET$Controls$Grid$get_rowData,
	
	refresh: jQueryNET$Controls$Grid$refresh,
	addRows: jQueryNET$Controls$Grid$addRows,

	_createHeader: jQueryNET$Controls$Grid$_createHeader,
	_createBody: jQueryNET$Controls$Grid$_createBody,
	_createFoter: jQueryNET$Controls$Grid$_createFoter,
	_onFirstPage: jQueryNET$Controls$Grid$_onFirstPage,
	_onLastPage: jQueryNET$Controls$Grid$_onLastPage,
	_onBackPage: jQueryNET$Controls$Grid$_onBackPage,
	_onForwardPage: jQueryNET$Controls$Grid$_onForwardPage,

	_updateButtonState: jQueryNET$Controls$Grid$_updateButtonState,

	_showLoadingLayer: jQueryNET$Controls$Grid$_showLoadingLayer,
	_hideLoadingLayer: jQueryNET$Controls$Grid$_hideLoadingLayer,
	_completeReceive: jQueryNET$Controls$Grid$_completeReceive,

	_onContextMenu: jQueryNET$Controls$Grid$_onContextMenu,
	_onScroll: jQueryNET$Controls$Grid$_onScroll,
	_onRowMouseOver: jQueryNET$Controls$Grid$_onRowMouseOver,
	_onRowMouseOut: jQueryNET$Controls$Grid$_onRowMouseOut,
	_onRowClick: jQueryNET$Controls$Grid$_onRowClick,
	_onRowDoubleClick: jQueryNET$Controls$Grid$_onRowDoubleClick,

	_onHeaderMouseOver: jQueryNET$Controls$Grid$_onHeaderMouseOver,
	_onHeaderMouseOut: jQueryNET$Controls$Grid$_onHeaderMouseOut,
	_onHeaderClick: jQueryNET$Controls$Grid$_onHeaderClick,
	
	add_rowClick: jQueryNET$Controls$Grid$add_rowClick,
	remove_rowClick: jQueryNET$Controls$Grid$remove_rowClick,
	raiseRowClick: jQueryNET$Controls$Grid$raiseRowClick,
	add_rowDoubleClick: jQueryNET$Controls$Grid$add_rowDoubleClick,
	remove_rowDoubleClick: jQueryNET$Controls$Grid$remove_rowDoubleClick,
	raiseRowDoubleClick: jQueryNET$Controls$Grid$raiseRowDoubleClick,
	add_contextMenu: jQueryNET$Controls$Grid$add_contextMenu,
	remove_contextMenu: jQueryNET$Controls$Grid$remove_contextMenu,
	raiseContextMenu: jQueryNET$Controls$Grid$raiseСontextMenu
}

jQueryNET.Controls.Grid.registerClass("jQueryNET.Controls.Grid", jQueryNET.Controls.DataControlBase);
